/*
 * Copyright (C) 2015-2018 EPAM Systems
 *
 * This file is part of Indigo ELN.
 *
 * Indigo ELN is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Indigo ELN is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Indigo ELN.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

@import 'variables.less';

.clearfix() {
  &:before,
  &:after {
    content: " ";
    display: table;
  }
  &:after {
    clear: both;
  }
}

// Border Radius
.border-radius(@radius) {
  -moz-border-radius: @radius;
  -webkit-border-radius: @radius;
  -khtml-border-radius: @radius;
  border-radius: @radius;
}

.border-top-radius(@radius) {
  border-top-right-radius: @radius;
  border-top-left-radius: @radius;
}

.border-right-radius(@radius) {
  border-bottom-right-radius: @radius;
  border-top-right-radius: @radius;
}

.border-bottom-radius(@radius) {
  border-bottom-right-radius: @radius;
  border-bottom-left-radius: @radius;
}

.border-left-radius(@radius) {
  border-bottom-left-radius: @radius;
  border-top-left-radius: @radius;
}

// Placeholder text
.placeholder(@placeholder-color) {
  &:-moz-placeholder {
    color: @placeholder-color;
  }
  &::-moz-placeholder {
    color: @placeholder-color;
  }
  &:-ms-input-placeholder {
    color: @placeholder-color;
  }
  &::-webkit-input-placeholder {
    color: @placeholder-color;
  }
}

.placeholder-size(@placeholder-size) {
  &:-moz-placeholder {
    font-size: @placeholder-size;
  }
  &::-moz-placeholder {
    font-size: @placeholder-size;
  }
  &:-ms-input-placeholder {
    font-size: @placeholder-size;
  }
  &::-webkit-input-placeholder {
    font-size: @placeholder-size;
  }
}

// Text overflow
.text-overflow() {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

// Drop shadows
.box-shadow(@shadow) {
  -webkit-box-shadow: @shadow;
  box-shadow: @shadow;
}

// Opacity
.opacity(@opacity) {
  opacity: @opacity;
  -moz-opacity: @opacity;
  -khtml-opacity: @opacity;
  @opacity-ie: (@opacity * 100);
  filter: ~"alpha(opacity=@{opacity-ie})";
  zoom: 1;
}

//Display Inline
.display-inline() {
  display: inline-block;
  vertical-align: middle;
}

//Box Sizing
.box-sizing(@box-sizing-type) {
  box-sizing: @box-sizing-type;
  -moz-box-sizing: @box-sizing-type;
  -webkit-box-sizing: @box-sizing-type;
}

//Display Table
.display-table() {
  display: table;
  .h-w(100%, 100%);
}

.display-cell() {
  display: table-cell;
  vertical-align: middle;
}

.display-flex-justify() {
  display: flex;
  display: -webkit-flex;
  justify-content: space-between;
  text-align: justify;
  text-align-last: justify;
  -webkit-box-align: justify;
}

//Position
.position-abs-top-left(@left, @top) {
  left: @left;
  position: absolute;
  top: @top;
}

.position-abs-top-right(@right, @top) {
  position: absolute;
  top: @top;
  right: @right;
}

.position-abs-bottom-left(@left, @bottom) {
  bottom: @bottom;
  left: @left;
  position: absolute;
}

.position-abs-bottom-right(@right, @bottom) {
  bottom: @bottom;
  position: absolute;
  right: @right;
}

.position-fixed-top-left(@left, @top) {
  left: @left;
  position: fixed;
  top: @top;
}

//parametrs
.h-w(@height, @width) {
  height: @height;
  width: @width;
}

//Transition
.transition(@transition-style, @transition-time, @transition-function) {
  -webkit-transition: @transition-style @transition-time @transition-function;
  transition: @transition-style @transition-time @transition-function;
}

.transform-center(@l-r, @t-b) {
  transform: translate(@l-r, @t-b);
  -webkit-transform: translate(@l-r, @t-b);
}

//For input group
.input-gr-addon() {
  vertical-align: middle;
  width: 1%;
  white-space: nowrap;
}

//For Select custom and file upload
.opacity-input() {
  cursor: pointer;
  .h-w(100%, 100%);
  .opacity(0);
  .position-abs-top-left(0, 0);
}

.set-list-item-border(@bg:@bg1) {
  background: @bg;
  border: none;
  content: "";
  position: absolute;
  z-index: 100;
}

.set-item-menu (@bg:@bg9, @color:@link-color4, @ta: left) {
  background: @bg;
  color: @color;
  font: 14px/34px;
  position: relative;
  text-align: @ta;
  z-index: 100;
}

//Icons
.set-icon-bg(@bg: @bg-blue, @br: 1px solid @bg1, @br-s: 0, @color: @bg1, @fs: 14px, @lh: 19px, @ht: 19px, @wt: 19px) {
  background: @bg;
  border: @br;
  border-radius: @br-s;
  color: @color;
  cursor: pointer;
  display: inline-block;
  font: @fs/@lh;
  height: @ht;
  position: relative;
  vertical-align: middle;
  text-align: center;
  width: @wt;
  .icon {
    &:before {
      content: "";
      position: absolute;
      top: 2px;
      left: 3px;
      color: #fff;
    }
  }
}

.table-sort-icon {
  margin-left: 5px;
  font-size: 12px;
  color: #7d7d7d;
}

//Flex
.flex {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}

.flex-row {
  .flex;
  flex-direction: row;
  align-items: stretch;
}

.flex-row-wrap {
  .flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
}

.flex-start-center {
  align-items: center;
  align-content: center;
  max-width: 100%;
  justify-content: flex-start;
}

.flex-center-center {
  align-items: center;
  align-content: center;
  max-width: 100%;
  justify-content: center;
}


